Launch Template
💡 Definition
A Launch Template contains the configuration information to launch an EC2 instance. It serves as a blueprint for creating instances, specifying details like the AMI, instance type, key pair, security groups, and user data.
🔑 Key Concepts
- Blueprint: Defines what to launch.
- Versioning: Supports versioning, so you can have multiple versions of a template (e.g., v1 uses
t2.micro, v2 usest3.micro) and easily roll back or upgrade. - Reusable: Can be used to launch individual EC2 instances or by an Auto Scaling Group.
- User Data: You can include scripts to run upon instance startup.
⚙️ How it Works
- Create: Define the parameters in the EC2 console.
- Version: Create new versions when you need to change the configuration.
- Launch: Select the template (and version) when launching an instance or configuring an ASG.
🎯 Use Cases
- Auto Scaling: The standard way to define the configuration for instances launched by an ASG.
- Standardization: Ensuring all developers launch instances with the same approved configuration.
💰 Pricing Model
- Free: There is no charge for creating or storing Launch Templates. You pay for the resources (EC2 instances) launched from them.
📝 Exam Tips (CLF-C02)
- Replaces Launch Configurations (older, deprecated feature).
- Supports versioning (Launch Configurations do not).
- Used by Auto Scaling Groups.
See Also: * Auto Scaling * EC2 * AMI